package weixin02.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import weixin02.entity.SysUser;
import weixin02.service.SysUserService;
import org.springframework.web.bind.annotation.*;
import weixin02.util.R;

import javax.annotation.Resource;

/**
 * (SysUser)表控制层
 * @author makejava
 * @since 2021-07-06 21:14:24
 */
@Api(tags = "管理员信息接口")
@Controller
@RequestMapping("SysUser")
public class SysUserController {

    @Resource
    private SysUserService sysUserService;

    //前往登录页面
    @ApiOperation(value = "登录",notes = "前往登录页面")
    @GetMapping("login")
    public String getLoginPage() {
        return "/views/login";
    }

    //登录验证
    @ApiOperation(value = "登录",notes = "登录验证，登录成功返回 code‘0’")
    @ResponseBody
    @PostMapping("login")
       public R login(SysUser sysUser){
        return sysUserService.login(sysUser);
    }


}
